import os
from pathlib import Path
from mootdx.quotes import Quotes


client = Quotes.factory(market='std', multithread=True, heartbeat=True, bestip=True, timeout=15)

def getclient():
    global client
    return client;

if __name__ == '__main__':
    '''
    config = 'config.json'
    filename = os.path.abspath(os.path.join(os.getcwd(), "../..", config))
    print(filename)
    print("111111")
    # 标准市场
    client = Quotes.factory(market='std', multithread=True, heartbeat=True, bestip=True, timeout=15)
    print("22222")
    '''
    # k 线数据
    #data = client.bars(symbol='600036', frequency=9, offset=10)
    #data = client.minute(symbol='600036')
    data = client.bars(symbol='600036', frequency=0, offset=10)
    print("数据：")
    print(data.to_string(header=True, sparsify=False))
    ##print(data)
